<?php
//引入头部数据
include './head.php';

/**文章推荐**/
$sql="select w.*,c.name as cname,c.id as cfid from
(select w.*,c.name,c.pid from bl_wz as w join bl_class as c on w.cid=c.id where w.tj=2 and w.stat=1) as w
    left join bl_class as c on c.id = w.pid";

$arr=db_sel($sql,2); //得出文章对应的分类和上级分类

/**最新文章**/
$sql="select id,title from bl_wz order by time desc limit 5";
$data=zxwz($sql);

/**点击排行**/
$sql="select id,title from bl_wz order by ydl desc limit 5";
$djph=djph($sql);

?>
<div class="banner">
    <section class="box">
        <ul class="texts">
           <p><?php echo $wzarr['w_msg']?></p>
        </ul>
        <div class="avatar"><a href="#"><span><?php echo $wzarr['nickname']?></span></a> </div>
    </section>
</div>

<article>
    <h2 class="title_tj">
        <p>文章<span>推荐</span></p>
    </h2>
    <div class="bloglist left">

        <?php foreach($arr as $v){?>
            <h3><?php echo $v['title']?></h3>
            <figure><img src="<?php echo $v['img']?>"></figure>
            <ul>
                <p><?php echo $v['msg']?></p>
                <a title="/" href="./new.php?id=<?php echo $v['id']?>" target="_blank" class="readmore">阅读全文>></a>
            </ul>
            <p class="dateview">
                <span><?php echo date('Y-m-d',$v['time'])?></span>
                <span>作者：<?php echo $v['user']?></span>
<!--                判断 有无上级分类-->
                <?php if($v['cname']){?>
                    <span><?php echo $v['cname']?>：
                        [<a href="./newlist.php?cid=<?php echo $v['cid']?>"><?php echo $v['name']?></a>]
                    </span>
                <?php }else{?>
                    <span>
                        <a href="./newlist.php?cid=<?php echo $v['cid']?>"><?php echo $v['name']?></a>
                    </span>
                <?php }?>
            </p>
        <?php }?>
    </div>
    <aside class="right">
        <div class="weather"><iframe width="250" scrolling="no" height="60" frameborder="0" allowtransparency="true" src="http://i.tianqi.com/index.php?c=code&id=12&icon=4&num=1"></iframe></div>
        <div class="news">
            <?php echo $data?>

            <!--            点击排行-->
            <?php echo $djph?>

            <h3 class="links">
                <p>友情<span>链接</span></p>
            </h3>
            <ul class="website">
                <li><a href="/">个人博客</a></li>
                <li><a href="/">谢泽文个人博客</a></li>
                <li><a href="/">3DST技术网</a></li>
                <li><a href="/">思衡网络</a></li>
            </ul>
        </div>
        <!-- Baidu Button BEGIN -->
        <div id="bdshare" class="bdshare_t bds_tools_32 get-codes-bdshare"><a class="bds_tsina"></a><a class="bds_qzone"></a><a class="bds_tqq"></a><a class="bds_renren"></a><span class="bds_more"></span><a class="shareCount"></a></div>
        <script type="text/javascript" id="bdshare_js" data="type=tools&amp;uid=6574585" ></script>
        <script type="text/javascript" id="bdshell_js"></script>
        <script type="text/javascript">
            document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000)
        </script>
        <!-- Baidu Button END -->
        <a href="/" class="weixin"> </a></aside>
</article>
<footer>
    <p>Design by DanceSmile <a href="http://www.mycodes.net/" title="源码之家" target="_blank">源码之家</a> <a href="/">网站统计</a></p>
</footer>
<script src="../public/home/js/silder.js"></script>
</body>
</html>
